﻿/** AulacSoft **/
/** AuthorWrite: Thangnc **/
/** DateCode: 2010/11/10 **/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using Aulac.Client.Reports.Ems.Forms;

namespace Aulac.Client.Reports.Ems.VchPrints
{
    public class RptVchPrint
    {
        string mRdlcFile = null;
        XmlDataDocument xmlDoc = null;
        
        public RptVchPrint(XmlDataDocument pXmlData, string pRdlcFile)
        {
            mRdlcFile = pRdlcFile;
            xmlDoc = pXmlData;
        }
        
        private static FormRptVchPrintEms frmPrint = null;
        
        /// <summary>
        /// Hien thi Form Print
        /// </summary>
        /// <param name="xmlData">Du lieu can Print</param>
        /// <param name="pRptFile">File Rpt</param>
        public static void ShowReport(XmlDataDocument xmlData, string pRptFile)
        {
            /** AulacSoft **/
            /** AuthorWrite: Thangnc **/
            /** DateCode: 2010/11/10 **/
            RptVchPrint rpt = new RptVchPrint(xmlData, pRptFile);
            rpt.ShowReport();
        }
       
        public void ShowReport()
        {
            /** AulacSoft **/
            /** AuthorWrite: Thangnc **/
            /** DateCode: 2010/11/10 **/
            ShowFormRptPrint();
        }
        public void ClearParamRpt()
        {
            if (Aulac.Client.Controls.Helper.ControlHelper.IsEmpty(frmPrint))
                return;
            frmPrint.ClearListParamRpt();
        }
        #region Private Methods
        private void ShowFormRptPrint()
        {
            /** AulacSoft **/
            /** AuthorWrite: Thangnc **/
            /** DateCode: 2010/11/10 **/
            if (Aulac.Client.Controls.Helper.ControlHelper.IsEmpty(frmPrint))
                frmPrint = new FormRptVchPrintEms(mRdlcFile);
            frmPrint.Show();
            frmPrint.ShowReport(xmlDoc);
        }

        #endregion
    }
}
